﻿@page
@model Movies.IndexModel

@{
    ViewData["Title"] = "Movies";
}

<h1>@ViewData["Title"]</h1>

<p>
    <a asp-page="./Create">Create New</a>
</p>

<table class="table">
    <thead>
        <tr>
            <th>@Html.DisplayNameFor(model => model.Movies[0].Id)</th>
            <th>@Html.DisplayNameFor(model => model.Movies[0].Title)</th>
            <th>@Html.DisplayNameFor(model => model.Movies[0].ReleaseDate)</th>
            <th>@Html.DisplayNameFor(model => model.Movies[0].Description)</th>
            <th>@Html.DisplayNameFor(model => model.Movies[0].Price)</th>
            <th>@Html.DisplayNameFor(model => model.Movies[0].Genre)</th>
            <th>@Html.DisplayNameFor(model => model.Movies[0].Preorder)</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
    @foreach (var item in Model.Movies)
    {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.Id)</td>
            <td>@Html.DisplayFor(modelItem => item.Title)</td>
            <td>@Html.DisplayFor(modelItem => item.ReleaseDate)</td>
            <td>@Html.DisplayFor(modelItem => item.Description)</td>
            <td>@Html.DisplayFor(modelItem => item.Price)</td>
            <td>@Html.DisplayFor(modelItem => item.Genre)</td>
            <td>@Html.DisplayFor(modelItem => item.Preorder)</td>
        </tr>
    }
    </tbody>
</table>
